import static org.junit.Assert.*;

import org.junit.Test;


public class GraphicEditorTest {
	@Test
	public void testParseCommandString() throws Exception {
		String cmdString = new String("I 5 6");
		BitmapCmd cmd = CmdParser.parseCmd(cmdString);
		
		assertTrue(cmd.mCommend == BitmapCmd.CMD_Initialize);
		assertEquals(5, cmd.mX1);		
		assertEquals(6, cmd.mY1);
		
		String cmdString2 = new String("I 4 9");
		BitmapCmd cmd2 = CmdParser.parseCmd(cmdString2);
		
		assertTrue(cmd2.mCommend == BitmapCmd.CMD_Initialize);
		assertEquals(4, cmd2.mX1);		
		assertEquals(9, cmd2.mY1);
		
		String cmdString3 = new String("C");
		BitmapCmd cmd3 = CmdParser.parseCmd(cmdString3);
		
		String cmdString4 = new String("S Test.bmp");
		BitmapCmd cmd4 = CmdParser.parseCmd(cmdString4);
		
		assertTrue(cmd3.mCommend == BitmapCmd.CMD_Clear);		
	}
	
	@Test
	public void testGenerateBitmap() throws Exception {
		String cmdString = new String("I 5 6");
		BitmapCmd cmd = CmdParser.parseCmd(cmdString);
		
		Bitmap editor = new Bitmap();
		editor.inputCmd(cmd);
		
		char[][] bitmap = editor.mBitmap;
		
		assertEquals(6,bitmap.length);
		assertEquals(7,bitmap[0].length);
		
		for(int i = 1; i <= 5; ++i) {
			for(int j = 1; j <= 6; ++j) {
				assertEquals('O', bitmap[i][j]); 
			}
		}
	}
	
	@Test
	public void testClearBitmap() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testFillPixel() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testFillV() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testFillH() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testDrawK() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testFillF() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testPrintBitmap() {
		//String
		fail("Not yet implemented");
	}
	
	@Test
	public void testExit() {
		//String
		fail("Not yet implemented");
	}

}
